package fortunata.servlets;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;

import fortunata.fswapps.vpoet.VPOETRequestGGData;

import java.io.IOException;

public class VPoetRequestGGServlet extends VPoetRequestServlet {

    /**
     * Initializes the servlet. It assigns the path to the onto files (defs and instances). Assumes that this servlet
     * is installed in the Fortunata web application
     * @param config
     * @throws javax.servlet.ServletException
     */
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
    }
    /**
     * Default constructor.
     */
    public VPoetRequestGGServlet(){

         //Moved to init(...)
    }

    /**
     * Overwrites the base method. Just to add a GG. Simple, isn't it?
     * @param request
     * @param res
     * @throws IOException
     * @throws ServletException
     */
    public void doSomething(HttpServletRequest request, HttpServletResponse res)
            throws IOException, ServletException {
        rpv = new VPOETRequestGGData(request.getRequestURL().append("?").append(request.getQueryString()).toString());
        handleVPOETRequest (request, res, rpv);
    }
}
